package com.example.app7;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

public class MyMessage implements Parcelable {


    private String message;

    public MyMessage() {
    }

    public MyMessage(String message) {
        this.message = message;
    }

    protected MyMessage(Parcel in) {
        message = in.readString();
    }

    public static final Creator<MyMessage> CREATOR = new Creator<MyMessage>() {
        @Override
        public MyMessage createFromParcel(Parcel in) {
            return new MyMessage(in);
        }

        @Override
        public MyMessage[] newArray(int size) {
            return new MyMessage[size];
        }
    };

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int i) {
        parcel.writeString(message);
    }
}
